/*****************************************************************************
 ** Copyright (c) 2010 Ushahidi Inc
 ** All rights reserved
 ** Contact: team@ushahidi.com
 ** Website: http://www.ushahidi.com
 **
 ** GNU Lesser General Public License Usage
 ** This file may be used under the terms of the GNU Lesser
 ** General Public License version 3 as published by the Free Software
 ** Foundation and appearing in the file LICENSE.LGPL included in the
 ** packaging of this file. Please review the following information to
 ** ensure the GNU Lesser General Public License version 3 requirements
 ** will be met: http://www.gnu.org/licenses/lgpl.html.
 **
 **
 ** If you have questions regarding the use of this file, please contact
 ** Ushahidi developers at team@ushahidi.com.
 **
 *****************************************************************************/

#import <UIKit/UIKit.h>
#import "IndexedTableCell.h"

@protocol TextViewTableCellDelegate;

@interface TextViewTableCell : IndexedTableCell<UITextViewDelegate> {
	
@public
	NSInteger limit;
	
@private
    UITextView *textView;
	id<TextViewTableCellDelegate> delegate;
	NSString *placeholder_;
}

@property (nonatomic, assign) NSInteger limit;
@property (nonatomic, assign) UITextAutocorrectionType autocorrectionType;
@property (nonatomic, assign) UITextAutocapitalizationType autocapitalizationType;
@property (nonatomic, assign) UIKeyboardType keyboardType;
@property (nonatomic, assign) UIReturnKeyType returnKeyType;

- (id)initForDelegate:(id<TextViewTableCellDelegate>)delegate reuseIdentifier:(NSString *)reuseIdentifier;

- (void) setText:(NSString *)text;
- (void) setPlaceholder:(NSString *)placeholder;
- (NSString *) getText;
- (void) showKeyboard;
- (void) hideKeyboard;

@end

@protocol TextViewTableCellDelegate <NSObject>

@optional

- (void) textViewFocussed:(TextViewTableCell *)cell indexPath:(NSIndexPath *)indexPath;
- (void) textViewChanged:(TextViewTableCell *)cell indexPath:(NSIndexPath *)indexPath text:(NSString *)text;
- (void) textViewReturned:(TextViewTableCell *)cell indexPath:(NSIndexPath *)indexPath text:(NSString *)text;

@end